package com.fingard.dsp.bank.reqrespobj.unifiedorder;

import com.fingard.text.StringHelper;

import java.util.HashMap;
import java.util.Iterator;


public class RetAtsUnifiedOrder {

	public String respCode;
    public String respInfo;
    public String rdSeq;

    public String transState;
	public String payInfo;
    public String payInfoCode;
    
    /**返回二维码类型，img代表是图片URL链接，取QRImgUrl，其它则为信息，取QRInfo，用该信息生成二维码*/
    public String qrType;
    public String qrInfo;
    public String qrImgUrl;
    public String outTransID;
    
    //public String prepayId;
    
    public HashMap<String,String> customHashMap;
    
    public HashMap<String,String> getRetAtsHashMap(){
    	HashMap<String,String> retHash = new HashMap<String,String>();
    	retHash.put("RespCode", respCode);
    	retHash.put("RespInfo", respInfo);
    	retHash.put("RdSeq", rdSeq);
    	if (StringHelper.hasAnyChar(transState)) {
    		retHash.put("TransState", transState);
    	}
    	if (StringHelper.hasAnyChar(payInfoCode)) {
    		retHash.put("PayInfoCode", payInfoCode);
    	}
    	if (StringHelper.hasAnyChar(payInfo)) {
    		retHash.put("PayInfo", payInfo);
    	}
    	
    	if(qrType == null){
    		qrType = "";
    		if (StringHelper.hasAnyChar(qrType)) {
    			retHash.put("QRType", qrType);
    		}
    	}
    	
    	if (StringHelper.hasAnyChar(qrInfo)) {
    		retHash.put("QRInfo", qrInfo);
    	}
    	if (StringHelper.hasAnyChar(qrImgUrl)) {
    		retHash.put("QRImgUrl", qrImgUrl);
    	}
    	if (StringHelper.hasAnyChar(outTransID)) {
    		retHash.put("OutTransID", outTransID);
    	}

    	if(customHashMap != null){
    		Iterator<String> iter = customHashMap.keySet().iterator();
    		while (iter.hasNext()) {
    			String eachKey = iter.next();
    			retHash.put(eachKey, customHashMap.get(eachKey));
    		}
    	}
    	return retHash;
    }
}
